<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
 <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Quản Lý Danh Mục</title>
<link href="styles.css" rel="stylesheet" type="text/css">
</head>
<body>
<div class="tknc" id="dn">
	<div class="login-header">
		<span>Sửa Danh Mục</span>
	</div>
	<div class="login-content">
	<form method = "POST" action="quanlydanhmuc?option=edit">
	Tên danh mục : <input type = "text" name = "tendanhmuc" value = ${listdm.get(0).getTendanhmuc() } required>
	<input type = hidden name = "madanhmuc" value = ${listdm.get(0).getMadanhmuc() }>
	<input type = "submit" value = "Lưu danh mục" >
	</form>
	</div>
</div>
	<jsp:include page="admin-header.jsp" />
		<form class="tknc" id ="themdm" accept-charset="UTF-8" method = "POST" action="quanlydanhmuc?option=addnew">
		<div class="login-header">
			<span>Thêm Danh Mục</span>
		</div>
		<div class="login-content">
		<label>Tên danh mục :</label>  
		<input type = "text" name = "tendanhmuc" required value = ${listdm.get(0).getTendanhmuc() } required>
		<input type = hidden name = "madanhmuc" value = ${listdm.get(0).getMadanhmuc() }>
		<input type = "submit" value = "Save" >
		</div>
		</form>
	<div class="admin-table">
            <h2>Thông Tin Danh Mục</h2>
            <table class="table-bordered">
    <thead>
	<tr>
            <th>Mã danh mục</th>
            <th>Tên danh mục</th>
	</tr>
	</thead>
            <tbody style="border: 1px solid #333;">
                <c:forEach items="${list}" var="list" >
                    <tr style="border: 1px solid #333;">
                        <td>${list.madanhmuc}</td>
                        <td>${list.tendanhmuc}</td>
                    </tr>
                </c:forEach>
            </tbody>
     	</table>
        </div>
</body>
</html>